﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Calendar</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" /><link href="../demo.css" rel="stylesheet" type="text/css" />

    
    <script src="../../scripts/boot.js" type="text/javascript"></script>
    
    
</head>
<body>
    <h1>Calendar 日期控件</h1>      
    
    <div id="calendar1" showDaysHeader="false" showClearButton="false" showOkButton="true" class="mini-calendar" value="2011-12-11 9:10:11"  onvaluechanged="onValueChanged" showTime="true" ondateclick="onDateClick"></div>
        
    
    <br /><br />
    <input type="button" value="setValue" onclick="setValue()"/>
    <input type="button" value="getValue" onclick="getValue()"/>    
    <input type="button" value="disable" onclick="disable()"/>
    <input type="button" value="enable" onclick="enable()"/>

    <script type="text/javascript">
     
        
        function setValue() {
            var obj = mini.get("calendar1");

            var d = new Date();
            obj.setValue(d);
        }
        function getValue() {
            var obj = mini.get("calendar1");
            alert(obj.getValue());
        }
        function enable() {
            var obj = mini.get("calendar1");
            obj.enable();
        }
        function disable() {
            var obj = mini.get("calendar1");
            obj.disable();
        }
        function onValueChanged(e) {
            var date = this.getValue();
            //alert(date);
        }
        function onDateClick(e) {            
//            if (this.getValue() != "") {
//                this.setTime(new Date());
//            }
        }
    </script>

    <div class="description">
        <h3>Description</h3>
        <p>Calendar可以用于"年/月/日"的选择；也可以精确到"时/分/秒"。</p>
    </div>
</body>
</html>